//////////////////////////////////////////////
// Static.js
//
//////////////////////////////////////////////

/// Class ------------------------------------
	
nkWinUiTests.Static = class Static extends nkDebug.TestClass
{
	static instance = new Static ("nkWinUiTests.Static") ;

	system = null ;

	// Methods
	async testBackgroundColor ()
	{
		return ;
		// Prepare window
		const manager = Static.instance.system.getComponentManager() ;
		const component = manager.createOrRetrieve("Test", nkWinUi.COMPONENT_TYPE.STATIC) ;
		component.setSize(150, 100) ;
		component.setLabel("Testing") ;
		component.setVisibleOnLoad(false) ;
		component.load() ;

		// Paint to image
		const componentImage = await component.paintToImage() ;

		// Check sanity
		nkDebug.TestUtils.areNumbersEqual(componentImage.getWidth(), 150, 0, "Wrong width") ;
		nkDebug.TestUtils.areNumbersEqual(componentImage.getHeight(), 100, 0, "Wrong height") ;
		nkWebUnitTests.ImageHandlingUtils.checkPixel(componentImage, new nkMaths.Vector (1, 12, 12, 255), 0, 0) ;
	}

	// Common test methods
	nkTests =
	{
		// Management
		__testInit__ : function ()
		{
			// Init nkGraphics
			Static.instance.system = new nkWinUi.System () ;

			const initResult = Static.instance.system.initialize() ;

			if (!initResult)
				console.log("Failure to initialize nkWinUi, bypassing Static test...")

			return initResult ;
		},
		__testShutdown__ : function ()
		{
			Static.instance.system.shutdown()  ;
			Static.instance.system.delete() ;
			Static.instance.system = null ;
		},

		// Constructors
		BackgroundColor : async function () {await Static.instance.testBackgroundColor() ;},
	}
}